package bg.btanev.eightyfour.shared.dto;

import java.util.HashSet;
import java.util.Set;

import bg.btanev.eightyfour.shared.dto.dtobase.DomainDtoEntity;
import bg.btanev.eightyfour.shared.dto.person.PersonDto;
import bg.btanev.eightyfour.shared.dto.profile.ProfileDto;
import bg.btanev.eightyfour.shared.dto.profile.ProfileEventDto;
import bg.btanev.eightyfour.shared.dto.target.TargetStatusDto;

/**
 *
 * @author B.Tanev
 *
 */
public class TargetDto extends DomainDtoEntity<Long> {
	/**
	 *
	 */
	private static final long serialVersionUID = -2697474006217050256L;

	private PersonDto person;
	private TargetStatusDto status;

	private Set<ProfileDto<? extends ProfileEventDto>> profiles = new HashSet<ProfileDto<? extends ProfileEventDto>>();

	public TargetDto() {
		super();
	}

	public PersonDto getPerson() {
		return person;
	}

	public void setPerson(PersonDto person) {
		this.person = person;
	}

	public TargetStatusDto getStatus() {
		return status;
	}

	public void setStatus(TargetStatusDto status) {
		this.status = status;
	}

	public Set<ProfileDto<? extends ProfileEventDto>> getProfiles() {
		return profiles;
	}

	public void setProfiles(Set<ProfileDto<? extends ProfileEventDto>> profiles) {
		this.profiles = profiles;
	}

	@Override
	public String toString() {
		return "TargetDto [person=" + person + ", status=" + status + ", toString()=" + super.toString() + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((person == null) ? 0 : person.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TargetDto other = (TargetDto) obj;
		if (person == null) {
			if (other.person != null)
				return false;
		} else if (!person.equals(other.person))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		return true;
	}
}
